﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InitialBuList.aspx.cs" Inherits="AuxiliaryManagement_BasicDataManagement_Initialbudget_InitialBuList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="../Includes/Guide.css" type="text/css" rel="stylesheet" />
    <link href="../Includes/index.css" type="text/css" rel="stylesheet" />
    <link href="../Includes/MasterPage.css" type="text/css" rel="stylesheet" />
    <link href="../Includes/xtree.css" type="text/css" rel="stylesheet" />
    <link href="../CSS/MyCss.css" type="text/css" rel="stylesheet" />
    <link href="../css/Style.css" rel="stylesheet" type="text/css" />
    <title>初始化预算列表</title>
</head>
<script src="../js/PageControl.js" type="text/javascript"></script>
<script src="../Includes/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../Includes/MyJScript.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    //刷新页面
    function reload() {
        //        window.open('ApprovalFlow.aspx', 'main_right');
        parent.$("#main_right").attr("src", 'BudgetManagement/InitialBuList.aspx');
    }
    function checkall(cb) {
        var cbs = document.getElementsByTagName("input");
        for (var i = 0; i < cbs.length; i++) {
            if (cbs[i].type == "checkbox") {
                cbs[i].checked = cb.checked;
            }


        }
    }
    $(document).ready(function() {
        $("#btnAdd").click(function() {
            parent.PE_FrameTab.AddNew();
            //            window.open('ApprovalFlow.aspx', 'main_right');
            parent.$("#main_right").attr("src", 'BudgetManagement/InitialBu.aspx');
            return false;
        });
        
        $("#btnDel").click(function() {
            if (!confirm("是否删除当前单据？"))
                return false;
        });

      
//        $("a").click(function() {

//            if ($(this).text().length < 8) {
//                return;
//            }
//            parent.PE_FrameTab.AddNew();
//            //            window.open('ApprovalFlow.aspx?aprvlno=' + $(this).text(), 'main_right');
//            parent.$("#main_right").attr("src", 'AuxiliaryManagement/BasicDataManagement/Initialbudget/InitialBu.aspx?sysno=' + $(this).text());
//        });

    });
    //行绑定双击时间
    function rowdblClick(obj) {
        parent.PE_FrameTab.AddNew();
        parent.$("#main_right").attr("src", 'BudgetManagement/InitialBu.aspx?sysno=' + obj);
    }
    //修改按钮事件
    function updClick() {
        var gv = document.getElementById('<%= GridView1.ClientID %>');
        for (i = 1; i < gv.rows.length; i++) {
            var items = gv.rows[i].cells[0].getElementsByTagName("input");
            if ((items[0].type == "checkbox") && (items[0].checked == true)) {
                var sysno = gv.rows[i].cells[2].innerText;
                parent.PE_FrameTab.AddNew();
                parent.$("#main_right").attr("src", 'BudgetManagement/InitialBu.aspx?sysno=' + sysno + '&flag = upd');

            }
        }     
        
    }
</script>
<body>
    <form id="form1" runat="server">
     <div class="inputbuttondiv">
<asp:Button ID="btnAdd" runat="server" Text="新增" CssClass="inputbutton" />
<asp:Button ID="btnUpd" runat="server" Text="修改" CssClass="inputbutton"  OnClientClick="updClick()"/>
<asp:Button ID="btnDel" runat="server" Text="删除" CssClass="inputbutton" onclick="btnDel_Click"     />
<asp:Button ID="btnCong" runat="server" Text="作废" CssClass="inputbutton"              />
<asp:Button ID="btnSub" runat="server" Text="审核" CssClass="inputbutton"   onclick="btnActive_Click" />
<asp:Button ID="btnSendSub" runat="server" Text="送审" CssClass="inputbutton"           />
<asp:Button ID="btnSendSubTrack" runat="server" Text="送审追踪" CssClass="inputbutton"  />
<asp:Button ID="btnColSec" runat="server" Text="列选" CssClass="inputbutton"    />
<asp:Button ID="btnDetailSec" runat="server" Text="详细查询" CssClass="inputbutton"     onclick="btnSec_Click"  />
<asp:Button ID="btnExport" runat="server" Text="导出" CssClass="inputbutton"    />
<asp:Button ID="btnPrint" runat="server" Text="打印" CssClass="inputbutton"     />
<asp:Button ID="btnActive" runat="server" Text="执行" CssClass="inputbutton" onclick="btnActive_Click"  Visible="false"
              />
</div>
<hr />
    <div>
    
        <table class="item" style="margin:0px 0px 0px 0px; width:700px">
            <tr>
                <td>预算编号：</td>
                <td>
                <asp:TextBox ID="txtsysno" runat="server" CssClass="inputtexttmp"></asp:TextBox>
                </td>
                <td>年度：</td>
                <td>
                    <asp:TextBox ID="txtUyear" runat="server" CssClass="inputtexttmp" Width="60px"></asp:TextBox></td>
                <td>期间：</td>
                <td>
                <div style=" height:20px;width:130px; position:relative;border-bottom:0px;">
               <asp:TextBox ID="txtapplyDept0" runat="server" style="position:absolute;left:0px;top:0px;width:110px;bottom:0px;"  CssClass="inputtexttmp"></asp:TextBox>
                    <asp:DropDownList ID="ddlperiod" runat="server" Width="130px" Height="20px"
                        AppendDataBoundItems="true">
                        <asp:ListItem Value="-1">-选择-</asp:ListItem>
                    </asp:DropDownList>
                    </div>
                </td>
                <td>
    <asp:Button ID="btnSec" runat="server" Text="查询" CssClass="inputbuttontb" Height=""     
                        onclick="btnSec_Click"  />
                
                </td>
            </tr>
            </table>
                
    </div>
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="sysno" BackColor="White" 
            onrowdatabound="GridView1_RowDataBound">
            <%--<SelectedRowStyle ForeColor="#0080FF" />--%>
            <Columns>
            <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox ID="orderAllCheckBox" runat="server" text="全选"
                        onclick="checkall(this)"/>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="orderCheckBox" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="序号" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Select" Text="<%# Container.DataItemIndex+1 %>"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle Width="50px" HorizontalAlign="Center"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </asp:TemplateField>
                <asp:BoundField DataField="sysno" HeaderText="预算编号" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="uyear" HeaderText="年度" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="period" HeaderText="期间" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="fillpsn" HeaderText="制表人" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="filldate" DataFormatString="{0:yyyy-MM-dd}" 
                    HeaderText="制表日期" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField HeaderText="审批人" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="activepsn" HeaderText="执行人" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
                <asp:BoundField DataField="activedate" DataFormatString="{0:yyyy-MM-dd}" 
                    HeaderText="执行日期" >
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
            </Columns>
        </asp:GridView>
    </div>
    </form>
</body>
</html>
